﻿@model Booking
@{
    ViewBag.Title = "BookingAdd";
    Layout = "~/Views/Shared/_Layout.cshtml";
    var DeskID = Convert.ToInt32(ViewData["DeskID"]);
}
<div class="main-container">
    <div class="modal-form">
        <div class="modal-form-body">
            <form id="Form" method="post" class="form-horizontal margin10-t" action="/Order/BookingAdd">
                <div class="contrl">
                    <label>姓名：</label>
                    <input type="hidden" name="DeskID" value="@DeskID" />
                    <input type="text" name="CustomerName" class="input">
                </div>
                <div class="contrl">
                    <label>手机号码：</label>
                    <input type="text" name="Phone" class="input">
                </div>
                <div class="contrl">
                    <label>人数：</label>
                    <input type="text" name="TotalPeople" class="input">
                </div>
                <div class="contrl">
                    <label>预订日期：</label>
                    @*<input type="text" name="BookingTime" id="BookingTime" class="input" placeholder="预订几点" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd HH:mm', el: 'BookingTime', isShowClear: false, readOnly: true })" />*@
                    <input type="text" name="BookingTime" class="input" id="BookingTime" value="@DateTime.Now" />
                    <input type="hidden" name="TimePoint" id="TimePoint" value="@DateTime.Now" />
                </div>
                <div class="contrl">
                    <label>备注说明：</label>
                    <input type="text" name="Remark" class="input">
                </div>
            </form>
        </div>
        <div class="modal-form-footer">
            <input type="button" class="btn-primary" value="保存" onclick="autoSubmit('Order', 'BookingAdd', 'BookingList')" />
            <input type="button" class="btn-secondary" value="取消" onclick="CloseModelFrame()">
        </div>
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function () {
        $("#Form").validate({
            rules: {
                CustomerName: {
                    required: true
                },
                TotalPeople: {
                    required: true
                },
                Phone: {
                    required: true
                },
                BookingTime: {
                    required: true
                }
            },
            messages: {
                CustomerName: {
                    required: "请输入类型号"
                },
                TotalPeople: {
                    required: "请输入人数"
                },
                Phone: {
                    required: "请输入手机号码"
                },
                BookingTime: {
                    required: "请输入预订时间"
                }
            },
            errorElement: "em"
        });
    });
</script>
